<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>保单详情</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="insPlcBscInfo_form">
    <div class="fieldset1 tabel_col clearFix">
        <div class="caption">
            <span class="title">保险保证金信息</span>
        </div>
        <div class="fieldBox col_33">
            <div class="label">保险保证金金额</div>
            <div class="field">
                ${feeAmt}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">资金状态</div>
            <div class="field">
                ${feeSts}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">处理方式</div>
            <div class="field">
                <input ligerui="width:135" name="handleWayCd" id="handleWayCd" data-value="${insPlcBscInfoVO.handleWayCd}" placeholder="请选择" ltype="combobox">
                <input type="text" style="display: none" name="paySchDId" id="paySchDId" value="${paySchDVO.id}">
                <input type="text" style="display: none" name="feeAmt" id="feeAmt" value="${paySchDVO.feeAmt}">
                <input type="text" style="display: none" name="feeTypCd" id="feeTypCd" value="${paySchDVO.feeTypCd}">
                <input type="text" style="display: none" name="paySchNo" id="paySchNo" value="${insPlcBscInfoVO.paySchNo}">
                <input type="text" style="display: none" name="paySchId" id="paySchId" value="${insPlcBscInfoVO.paySchId}">
                <span id="saveHandlerWay_Btn" class="sq-button sq-button-round l-dialog-btn-ok">保存</span>
            </div>
        </div>

        <c:if test="${not empty bkFlag and bkFlag==2}">
            <div class="fieldset1 tabel_col clearFix">
                <div class="caption">
                    <span class="title">收款账号信息</span>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">账户名称</div>
                    <div class="field">
                        <input ligerui="width:370" name="cstAccNm" id="cstAccNm" class="ui-textbox" value="${insPlcBscInfoVO.cstAccNm}" validate="{required:true,maxlength:60}">
                        <span class="requiredSymbol">*</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">银行账号</div>
                    <div class="field">
                        <input ligerui="width:370" name="cstAccNo" id="cstAccNo" class="ui-textbox" value="${insPlcBscInfoVO.cstAccNo}" validate="{required:true,maxlength:30}">
                        <span class="requiredSymbol">*</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">开户支行名称</div>
                    <div class="field">
                        <input ligerui="width:370" name="bkNm" id="bkNm" class="ui-textbox" value="${insPlcBscInfoVO.bkNm}" validate="{required:true,maxlength:100}">
                        <span class="requiredSymbol">*</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">开户行行号</div>
                    <div class="field">
                        <input ligerui="width:370" name="bkNo" id="bkNo" class="ui-textbox" value="${insPlcBscInfoVO.bkNo}" validate="{required:true,maxlength:30}">
                        <span class="requiredSymbol">*</span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">备注</div>
                    <div class="field">
                    <textarea name="bkAccRem" id="bkAccRem" class="ui-textarea l-textarea" cols="100" rows="3" style="width:97%;"
                              value="${insPlcBscInfoVO.bkAccRem}"
                              validate="{required:false,maxlength:200}">${insPlcBscInfoVO.bkAccRem}</textarea>
                    </div>
                </div>
                <div class="btnsBox">
                    <span id="saveBk_Btn" class="sq-button sq-button-round l-dialog-btn-ok">保存</span>
                </div>
            </div>
        </c:if>
        <c:if test="${not empty bkFlag and bkFlag==1}">
            <div class="fieldset1 tabel_col clearFix">
                <div class="caption">
                    <span class="title">收款账号信息</span>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">账户名称</div>
                    <div class="field">
                            ${insPlcBscInfoVO.cstAccNm}
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">银行账号</div>
                    <div class="field">
                            ${insPlcBscInfoVO.cstAccNo}
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">开户支行名称</div>
                    <div class="field">
                            ${insPlcBscInfoVO.bkNm}
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">开户行行号</div>
                    <div class="field">
                            ${insPlcBscInfoVO.bkNo}
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">备注</div>
                    <div class="field">
                            ${insPlcBscInfoVO.bkAccRem}
                    </div>
                </div>
            </div>
        </c:if>

        <div class="caption">
            <span class="title">保单基本信息</span>
        </div>
        <div class="fieldBox col_33">
            <div class="label">保险种类</div>
            <div class="field">
                ${insPlcBscInfoVO.insTypCdNm}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">保单号</div>
            <div class="field">
                ${insPlcBscInfoVO.plcNo}
            </div>
        </div>
        <!--jiangzg 2017-8-15 14:20:44 add paySchNo -->
        <div class="fieldBox col_33">
            <div class="label">支付表号</div>
            <div class="field">
                <a href="javascript:detailPaySchBtn()" class="link">${insPlcBscInfoVO.paySchNo}</a>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">保单产品类型</div>
            <div class="field">
            	${insPlcBscInfoVO.prdTypCdNm}
            </div>
        </div>

        <div class="fieldBox col_33">
            <div class="label">保险公司</div>
            <div class="field">
                ${insPlcBscInfoVO.insCompNm}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">保险公司所属省份</div>
            <div class="field">
                ${insPlcBscInfoVO.rgnPrCdNm}
            </div>
        </div>

        <div class="fieldBox col_33">
            <div class="label">保险公司所属城市</div>
            <div class="field">
                ${insPlcBscInfoVO.rgnCyCdNm}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">保险支公司</div>
            <div class="field">
            	${insPlcBscInfoVO.insCompSubNm}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">购买方式</div>
            <div class="field">
            	${insPlcBscInfoVO.buyWayCdNm}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">保单性质</div>
            <div class="field">
            	${insPlcBscInfoVO.plcPropCdNm}
            </div>
        </div>

        <div class="fieldBox col_33">
            <div class="label">保费总金额</div>
            <div class="field">
                ${insPlcBscInfoVO.insTtlFeeDb}
            </div>
        </div>

        <div class="fieldBox col_33">
            <div class="label">保单起始时间</div>
            <div class="field">
                ${insPlcBscInfoVO.plcBgTms}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">保单结束时间</div>
            <div class="field">
                ${insPlcBscInfoVO.plcEndTms}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">被保险人</div>
            <div class="field">
                <c:choose>
                    <c:when test="${insPlcBscInfoVO.audStsCd != null and insPlcBscInfoVO.audStsCd == '1'}">
                        ${insPlcBscInfoVO.insPerNm}
                    </c:when>
                    <c:otherwise>
                        <a href="javascript:detailInsPersonInfo(${insPlcBscInfoVO.cstId})" class="link">${insPlcBscInfoVO.insPerNm}</a>
                    </c:otherwise>
                </c:choose>

            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">被保险人证件号码</div>
            <div class="field">
                ${insPlcBscInfoVO.insPerCretNo}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">第一受益人</div>
            <div class="field">
                ${insPlcBscInfoVO.fstPer}
            </div>
        </div>

        <div class="fieldBox col_100">
            <div class="label">特别说明</div>
            <div class="field">
                ${insPlcBscInfoVO.plcRem}
            </div>
        </div>
        <%--<div class="fieldBox col_100" id="fileModify">
            <div class="label">电子保单</div>
            <div class="field">
                <jsp:include page="../../system/sysUlFilesRec/sysUlFileRecList.jsp" flush="true">
                    <jsp:param name="pkId" value="${insPlcBscInfoVO.id}"/>
                    <jsp:param name="tabNm" value="INS_PLC_BSC_INFO"/>
                </jsp:include>
            </div>
        </div>--%>

    </div>

    <div class="sqPanel">
        <div class="sqPanel_head inL">
            <span>保单资料</span>
            <span class="btns"><span class="sq-button sq-button-round" onclick="downloadInsFileByUrl();">打包下载</span></span>
        </div>
        <div class="sqPanel_body">
            <div id="insFileInfoCfgGrid" class="sq-grid"></div>
        </div>
    </div>

    <div class="fieldset1 tabel_col clearFix">
        <div class="caption">
            <span class="title">保单产品信息</span>
        </div>
        <div class="fieldBox col_100">
        	<div id="ligergrid_insprd" class="sq-grid"></div>
        </div>
    </div>

    <div class="fieldset1 tabel_col clearFix">
        <div class="caption">
            <span class="title">历史保单</span>
        </div>
        <div class="fieldBox col_100">
            <div style="width:100%;" id="portalMain"></div>
        </div>
    </div>

    <div class="fieldset1 tabel_col clearFix">
        <div class="caption">
            <span class="title">逾期记录</span>
        </div>
        <div class="fieldBox col_100">
            <div id="ligergrid_collect" class="sq-grid"></div>
        </div>
    </div>

    <div class="btnsBox" style="text-align: center;">
        <span id="back_Btn" class="sq-button sq-button-round l-dialog-btn-ok">关闭</span>
        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
    </div>
</form>
<script>
    var instypGrid=null,form=null;
    var insFileInfoCfgGrid = null;//保单资料配置明细
    var ctrlKey='${ctrlKey}';
    var serverPrefixPath = "";
    $(function () {
        var insPlcBscInfoId = "${insPlcBscInfoVO.id}";//主键ID
        /*返回*/
        $("#back_Btn").click(function (event) {
            Remove_navTab();
        });

        $("#handleWayCd").ligerComboBox({
            valueField: 'key',
            textField: 'value',
        });

        form = $("#insPlcBscInfo_form").ligerForm({
            validate:true
        });
        liger.get("handleWayCd").setData(${handleWayCdList});
        <c:choose>
            <c:when test="${not empty saveFlag and saveFlag==1}">
                form.setFieldValidate("handleWayCd", {required: true});
                $("#saveHandlerWay_Btn").show();
            </c:when>
            <c:otherwise>
                liger.get("handleWayCd").setDisabled(true);
                form.setFieldValidate("handleWayCd", {required: false});
                $("#saveHandlerWay_Btn").hide();
            </c:otherwise>
        </c:choose>
        //jiangzg modify 2017-9-19 15:57:35 商助驳回之后不能选择处理方式
        /*if("${insPlcBscInfoVO.handleWayCd}"){
            liger.get("handleWayCd").setDisabled(true);
        }*/

        //获取服务器路径前缀
        $.ajax({
            type: 'get',
            url: '<%=path%>/system/sysulfilesrec/getServerPath.do',
            success:function(msg){
                serverPrefixPath = msg;
            }
        });

        //保单资料Grid
        insFileInfoCfgGrid = $("#insFileInfoCfgGrid").ligerGrid({
            url: '<%=path%>/project/prjFileCfgInfo/initInsPlcFileInfoList.do?isShowSts=1&plcId=${insPlcBscInfoVO.id}&prjId=${insPlcBscInfoVO.prjId}',
            method: 'get',
            async:false,
            columns: [
                {display: '资料名称', name: 'datNm',align: 'left', minWidth: 100, enabledSort: false},
                {display: '上传文件名称', name: 'fileNm', minWidth: 100, enabledSort: false,
                    render:function(rowdata,rowindex,value){
                        if(value){
                            var h;
                            h='<a href="javascript:uploadFileByUrl(';
                            h+="'"+rowdata.filePath+"'";
                            h+=",'"+rowdata.fileNm+"'";
                            h+=')">'+rowdata.fileNm+'</a>'
                            return h;
                        }
                    }
                },
                {display: '上传时间', name: 'crtTm',align: 'left', minWidth: 100, enabledSort: false,render:renderDate},
                {display: '状态', name: 'audStsCdNm', width: 100, enabledSort: false},
                {display: '操作', name: 'option', minWidth: 100,align: 'left', enabledSort: false,
                    render:function(rowdata,rowindex,value){
                        var h='';
                        if(ctrlKey==1){
                            if (rowdata.fileNm) {
                                if(rowdata.fileId) {
                                    <sys:FlowFrmAth preTaskIds="${preTaskIds}" athCd="addPrjFile" pInstId="${pInstId}">
                                    h += '<a class="sq-button-hasicon" style="cursor:pointer;" onclick="delFile(event,' + rowdata.fileId + ',' + rowindex +','+rowdata.cfgDtlCd+');"><i class="sqBtnIco_7"></i>删除</a>';
                                    </sys:FlowFrmAth>
                                }else{
                                    <sys:FlowFrmAth preTaskIds="${preTaskIds}" athCd="addPrjFile" pInstId="${pInstId}">
                                    h += '<a class="sq-button-hasicon" style="cursor:pointer;" onclick="delUpLoadindFile(event,' + rowindex +','+rowdata.cfgDtlCd+');"><i class="sqBtnIco_7"></i>删除</a>';
                                    </sys:FlowFrmAth>
                                }
                            }
                        }else if(ctrlKey==2){
                            if(rowdata.filePath) {
                                h += '<a class="sq-button-hasicon" style="cursor:pointer;" onclick="modifyAudStsCd(event,' + rowdata.fileId + ',1);"><i class="sqBtnIco_15"></i>验证通过</a>';
                                h += '<a class="sq-button-hasicon" style="cursor:pointer;" onclick="modifyAudStsCd(event,' + rowdata.fileId + ',2);"><i class="sqBtnIco_14"></i>验证不通过</a>';
                            }
                        }
                        return h;
                    }
                },
                {display: '上传', name: 'uploadNm', width: 80,align: 'left', enabledSort: false,
                    render:function(rowdata,rowindex,value){
                        var h='';
                        if(ctrlKey==1){
                            <sys:FlowFrmAth preTaskIds="${preTaskIds}" athCd="addPrjFile" pInstId="${pInstId}">
                            h+='<span class="sq-button sq-button-round fileupload-button">上传<input type="file" id="fileup_'+rowdata.cfgCd+'_'+rowdata.cfgDtlCd+'" multiple name="fileup_'+rowdata.cfgCd+'_'+rowdata.cfgDtlCd+'"' +
                                ' class="fileupload-input" onchange="onChangefile_multi(event,\''+rowdata.cfgCd+'\',\''+rowdata.cfgDtlCd+'\',\''+rowdata.orgCd+'\',\''+rowindex+'\',\''+rowdata.__id+'\')"></span>';
                            </sys:FlowFrmAth>
                        }
                        return h;
                    }
                },
            ],
            root: 'rows',
            hideLoadButton : true,
            width: '100%',
            height: '100%',
            isScroll: false,
            rownumbers:true,  //显示序号
            checkbox: false,
            allowUnSelectRow:true,
            alternatingRow: false,
            frozen: false,
            usePager: false,
            onAfterShowData: function (){
                $('#insFileInfoCfgGrid').rowspan('datNm');
                // $('#insFileInfoCfgGrid').rowspan('uploadNm');
            },
        });


        //保单产品明细
        plcPrdGrid = $("#ligergrid_insprd").ligerGrid({
            url: '<%=path%>/insurance/insPlcBscInfo/initPlcPrdList.do?prjPrdDtlId=${insPlcBscInfoVO.prjPrdDtlId}',
            method: 'get',
            columns: [
                {display: '产品名称', name: 'prdNm', minWidth: 100, align: 'center'},
                {display: '产品型号', name: 'prdMdl', width: 100, align: 'left'},
                {display: '厂商', name: 'mfrNm', minWidth: 100, align: 'left'},
                {display: '供应商', name: 'splNm', minWidth: 100, align: 'left'},
                {display: '发动机编号', name: 'engMdl', width: 100, align: 'left'},
                {display: '车架号', name: 'vinNo', width: 100, align: 'left'},
                {display: '底盘号', name: 'chsNo', width: 100, align: 'left'},
                {
                    display: '单价', name: 'prdAmt', width: 90, align: 'right',
                    render: function (rowdata, rowindex, value) {
                        return '&yen;' + FormatMoney(rowdata.prdAmt / 100);
                    }
                },
                {
                    display: '合格证号', name: 'certNo', minWidth: 100, align: 'left',
                    render: function (rowdata, rowindex, value) {
                        if (value) {
                            return '<a href="javascript:;" onclick="detailBtn(' + rowdata.actPrdId + ',' + rowdata.prjPrdDtlId + ')">' + rowdata.certNo + '</a>';
                        }
                    }
                },
                {display: '客户名称', name: 'cstNm', width: 100, align: 'left'},
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            heightDiff: -2,
            allowUnSelectRow: true,
            alternatingRow: false
        });

        //逾期记录
        collectGrid = $("#ligergrid_collect").ligerGrid({
            url: '<%=path%>/risk/ovdCollect/searchOvdDtlList.do?cstId=${insPlcBscInfoVO.cstId}&paySchId=${insPlcBscInfoVO.paySchId}',
            method: 'get',
            columns: [
                {display: '支付表状态', name: 'prdStsCdNm', minWidth: 110, align: 'left',
                    render:function (rowdata,rowindex,value) {
                        return '<span class="gridTip" style="cursor: pointer;" title="' + rowdata.prdStsCdNm + '">' + rowdata.prdStsCdNm + '</span>';
                    }
                },
                {display: '支付表', name: 'paySchNo', width: 160, align: 'left'},
                {display: '联系人', name: 'lkMan', width: 100, align: 'left'},
                {display: '联系电话', name: 'lkPhone', width: 100, align: 'left'},
                {display: '逾期日期', name: 'overdueDate', minWidth: 90, align: 'center',render:renderDate},
                {display: '逾期天数', name: 'overdueDay', minWidth: 90, align: 'center'},
                {display: '逾期金额', name: 'overdueAmount', width: 90, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        return '&yen;'+FormatMoney(rowdata.overdueAmount/100);
                    }
                },
                {display: '罚息金额', name: 'penaltyAmount', width: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        return '&yen;'+FormatMoney(rowdata.penaltyAmount/100);
                    }
                },
                {display: '应收金额', name: 'recAmt', minWidth: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        return '&yen;'+FormatMoney(rowdata.recAmt/100);
                    }
                },
                /*{display: '应收时间', name: 'overdueDate', minWidth: 100, align: 'center',render:renderDate},*/
            ],
            usePager: false,
            root: 'rows',
            hideLoadButton : true,
            width: '100%',
            height: 'auto',
            isScroll: false,
            rownumbers:true,  //显示序号
            checkbox:false,
            allowUnSelectRow:true,
            alternatingRow: false
        });

        $("#portalMain").ligerPortal({
            columns: [{
                width: '100%',
                panels:[
                <c:if test="${not empty hisPlcList}">
                    <c:forEach items="${hisPlcList}" var="item">
                        {
                            title: '保单号：<c:out value="${item.value}"/>',
                            width: '100%',
                            height : '600',
                            initCollapse: true,
                            onToggle: function (isCollapse) {
                                if (!this.frame && !isCollapse) {
                                    this._setUrl('<%=path%>/insurance/insPlcBscInfo/toDetailPage.do?colseFlag=1&id=<c:out value="${item.key}"/>');
                                }
                            }
                        },
                    </c:forEach>
                </c:if>
            ]}]
        });

        //保存处理方式
        $("#saveHandlerWay_Btn").click(function(){
            var form = liger.get("insPlcBscInfo_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            data['id']=insPlcBscInfoId;
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: '<%=path%>/insurance/insPlcBscInfo/saveHandleWay.do',
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({
                        content: LogUtils.LOG_CMM_DATA_LOADING,
                        SQ_type: "waitting"
                    });
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });

        //保存收款银行账号信息
        $("#saveBk_Btn").click(function(){
            var form = liger.get("insPlcBscInfo_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            data['id']=insPlcBscInfoId;
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: '<%=path%>/insurance/insPlcBscInfo/saveBkInfo.do',
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({
                        content: LogUtils.LOG_CMM_DATA_LOADING,
                        SQ_type: "waitting"
                    });
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });
    });

    function getUlFileRecDelColumn(){

    }


    function uploadFileByUrl(_url,_name){
        if (_url.indexOf("http") < 0) {
            if(serverPrefixPath.length >1 && serverPrefixPath.indexOf("\"")>=0){
                serverPrefixPath = serverPrefixPath.substring(1,serverPrefixPath.length-1);
                _url = serverPrefixPath + _url;
            }
        }

        if(SQ.regs.img.test(_name)){
            //SQ.imgPreview(_url);
            //SQ.imgPreview(_url, true);
            window.__ImgSrc = _url;
            window.__ImgTit = _name;
            window.open('<%=path%>/project/prjbscinfo/imgWinOpen.do', '', 'location=yes, width=800, height=600');
        }else{
            window.open(_url);
        }
    }


    function downloadInsFileByUrl() {
        var data = insFileInfoCfgGrid.getData();
        //var files = [];
        var ids = [];
        for (var i = 0; i < data.length; i++) {
            var map = {};
            /* if(data[i].filePath){
                map.name = data[i].fileNm;
                map.path = data[i].filePath.substring(data[i].filePath.indexOf("attachments"));
                files.push(map);
            } */
            if(StringUtils.isNotEmpty(data[i].fileId)){
                ids.push(data[i].fileId);
            }
        }
        var actoinURL = '<%=path%>/system/sysulfilesrec/zipDownloadById.do?';
        var form = $("<form>");
        $('body').append(form);
        form.attr('style','display:none');
        form.attr('target','');
        form.attr('method','post');
        form.attr('action',actoinURL);//下载文件的请求路径
        var input = $('<input>');
        input.attr('type','hidden');
        input.attr('name','ids');
        input.attr('value',JSON.stringify(ids));
        form.append(input);
        form.submit();
    }

    //合格证详情
    function detailBtn(id, dtlId) {
        var detailFlag = true;
        Add_navTab('tab_prj_prd_veh_info_detail'+id,'合格证详情','<%=path%>/project/prjprdvehinfo/toDetailPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+dtlId);
    }

    //jiangzg 2017-8-21 15:12:35 add 查看支付表明细
    function detailPaySchBtn(prjPrdDtlId,paySchId,prjPrdId,prjId){
        var editFlag = true;
        var prjId = '${insPlcBscInfoVO.prjId}';
        var prjPrdDtlId = '${insPlcBscInfoVO.prjPrdDtlId}';
        var prjPrdId = '';
        var paySchId = '${insPlcBscInfoVO.paySchId}';
        Add_navTab('tab_prj_quat_prps'+paySchId,'查看支付表','<%=path%>/project/prjprdpayschm/toAddPage.do?prjId='+prjId+'&&id='+paySchId+'&&prjPrdDtlId='+prjPrdDtlId+'&&prjPrdId='+prjPrdId+'&&detailFlag='+editFlag);
    }
    //jiangzg 2017-8-25 14:31:15 add 查看被保险人(客户)信息
    function detailInsPersonInfo(id){
        Add_navTab('tab_cst_detail'+id,'客户详情','<%=path%>/customer/cstbscinfo/toCustDetailPage.do?id='+id);
    }

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }

    /**
     * 格式化金额
     */
    function formatCurrency(num) {
        if (!num) return "0.00";
        num = num.toString().replace(/\$|\,/g, '');
        if (isNaN(num))
            num = "0.00";
        sign = (num == (num = Math.abs(num)));
        num = Math.floor(num * 100 + 0.50000000001);
        cents = num % 100;
        num = Math.floor(num / 100).toString();
        if (cents < 10)
            cents = "0" + cents;
        for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
            num = num.substring(0, num.length - (4 * i + 3)) + ',' +
                    num.substring(num.length - (4 * i + 3));
        return (((sign) ? '' : '-') + '' + num + '.' + cents);
    }
</script>
</body>
</html>
